package net.cruciblesoftware.ghostspacekillah;

import android.app.Activity;
import android.os.Bundle;

public class KillahActivity extends Activity {
    private SceneView view;
    private KillahThread thread;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        logi("in onCreate...");

        // must load resources before creating content view
        Assets.load(this.getResources());
        Settings.load(this.getResources());
        setContentView(R.layout.main);
     
        view = (SceneView)findViewById(R.id.scene);
        thread = view.getThread();
    }

    @Override
    public void onRestart() {
        super.onRestart();
        logi("in onRestart...");
    }

    @Override
    public void onStart() {
        super.onStart();
        logi("in onStart...");
    }

    @Override
    public void onResume() {
        super.onResume();
        logi("in onResume...");
        thread.pauseThread(false);
    }

    @Override
    public void onPause() {
        super.onPause();
        logi("in onPause...");
        thread.pauseThread(true);
    }

    @Override
    public void onStop() {
        super.onStop();
        logi("in onStop...");
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        logi("destroying something beautiful...");
    }


    /* Logging functions */
    private void logi(String msg) {
        android.util.Log.i(this.getClass().getName(), msg);
    }
    private void logw(String msg) {
        android.util.Log.w(this.getClass().getName(), msg);
    }
    private void loge(String msg) {
        android.util.Log.e(this.getClass().getName(), msg);
    }
}
